package com.css.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 订单类型
 */
@Getter
@AllArgsConstructor
public enum DdlxEnum {
    DDLX_BTOC("01", "B扫C支付（被扫）"),

    DDLX_CTOB("02", "C扫B支付（主扫）"),

    DDLX_CTOB_MP("03", "C扫B支付（主扫）-码牌"),

    DDLX_WXXCX("11", "微信小程序"),

    DDLX_XCX_ZFB("12", "小程序-支付宝下单"),

    DDLX_XCX_YSF("13", "小程序-云闪付下单"),

    DDLX_GZH_WX("21", "公众号-微信下单"),

    DDLX_GZH_ZFB("22", "公众号-支付宝后台下单"),

    DDLX_GZH_YSF("23", "公众号-云闪付后台下单"),

    DDLX_NO_PAY("99", "无支付");

    private final String dm;

    private final String mc;

    public static String getMc(String dm) {
        DdlxEnum res = Arrays.stream(values())
                .filter(x -> x.getDm().equals(dm))
                .findFirst().orElse(null);
        return res == null ? null : res.getMc();
    }
}
